package com.health.controller;

import com.health.pojo.ExamineOrder;
import com.health.pojo.HealthAttributes;
import com.health.service.HealthComboService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

// 查询下拉框的套餐
@WebServlet(value = "/medicalSearch")
public class MedicalPlanSearchServlet extends HttpServlet {
    HealthComboService healthComboService = new HealthComboService();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //  查询套餐以及检查项数据
        List<ExamineOrder> examineOrderList = healthComboService.selectByCombo();
        System.out.println(examineOrderList);

        //  设置到请求域中
        request.setAttribute("examineOrderList", examineOrderList);
        // 设置侧边栏状态
        request.setAttribute("asideStatus", 2);
        request.getRequestDispatcher("/restrictedPages/main.jsp").forward(request, response);

    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        super.doPost(request, response);
    }
}
